package com.ngo100.demo.controller;

import com.ngo100.demo.dto.IdCardDTO;
import com.ngo100.demo.dto.ResultDTO;
import com.ngo100.demo.service.IdCardService;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/api/idcard")
public class IdCardController {

    @Resource
    private IdCardService idCardService;

    // 读取身份证信息接口
    @GetMapping("/read")
    public ResponseEntity<ResultDTO> readIdCard() {
        IdCardDTO idCardDTO = idCardService.readIdCard();
        return ResponseEntity.ok(new ResultDTO(200, "success", idCardDTO));
    }
}
